<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>项目账户管理系统</title>
    <meta name="keywords" content="项目账户管理系统">
    <meta name="description" content="项目账户管理系统">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link rel="shortcut icon" href="/favicon.ico">

    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/font-awesome.min.css" rel="stylesheet">
    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min.css" rel="stylesheet">
    <link href="/css/my.css" rel="stylesheet">
    <!-- 全局js -->
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <!--导航-->
    <script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <!--滚动条-->
    <script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <!--经典模块化前端框架-->
    <script src="/js/plugins/layer/layer.min.js"></script>
    <script src="/js/plugins/sweetalert/sweetalert.min.js"></script>
    <link href="/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <!-- 自定义js-->
    <script src="/js/hplus.min.js"></script>
    <script src="/js/contabs.min.js"></script>
    <script src="/js/common.js?r=1"></script>
    <link rel="stylesheet" href="/css/plugins/chosen/chosen.css">


</head>

<?php $url = explode('?',$_SERVER["REQUEST_URI"])[0];?>
<body class="fixed-sidebar full-height-layout gray-bg">

<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <img alt="image" class="img-circle" src="/img/logo.png" style="width:100px" />
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                                <span class="text-muted text-xs block"><?php echo !empty(Yii::$app->user->identity->username) ? Yii::$app->user->identity->username : '';?><b class="caret"></b></span>
                                </span>
                        </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a href="<?= yii\helpers\Url::to(['site/update-password'])?>">修改密码</a></li>
                            <li class="divider"></li>
                            <li><a href="<?= yii\helpers\Url::to(['site/logout'])?>">安全退出</a></li>
                        </ul>
                    </div>
                    <div class="logo-element"><img src="/img/logo.png" width="50px" /></div>
                </li>
                <!-- class="active"-->
                <?php if(!empty($this->params['menu'])){foreach($this->params['menu'] as $key => $value){?>
                    <li>
                        <a href="#">
                            <i class="fa fa fa-gear"></i>
                            <span class="nav-label"><?php echo $value['name'];?></span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <?php if(!empty($value['child'])){foreach($value['child'] as $k => $v){?>
                                <li>
                                    <a href="<?php echo $v['url'];?>"><?php echo $v['name'];?></a>
                                </li>
                            <?php }}?>
                        </ul>
                    </li>
                <?php }}?>
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->

    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                </div>
            </nav>
        </div>
        <div class="row J_mainContent" id="content-main">
            <!--子页面-->
            <?php $this->beginBody() ?>

            <?= $content ?>

            <?php $this->endBody() ?>
            <!--/子页面-->
        </div>
    </div>
    <!--右侧部分结束-->
    <!--弹出搜索框-->
    <?= $this->render(
        '/layouts/search_model.php'
    ) ?>
</div>
<script>
    $(function(){
        //刷新默认选中
        if(localStorage.menu_i != undefined){
            $('#side-menu li').eq(localStorage.menu_i).addClass('active').parent('ul').addClass('in').parent('li').addClass('active');
        }
        //记录点击菜单
        $('#side-menu li ul.nav-second-level li').click(function(){
            var i = $('#side-menu li').index($(this));
            localStorage.menu_i = i;
        });
    });
//tab切换
$.fn.tabSwitch = function(options){
    var options = $.extend({
        eventType: "click",
        switchNav: ".z-character-name",
        switchCont: ".table-responsive",
        active: "z-chose-char",
        active2: "active"
    },options||{});
    return this.each(function(){
        var _this = $(this);
        _this.find(options.switchNav).bind(options.eventType, function(){
            var _index = $(this).index();
            $(this).addClass(options.active).siblings(options.switchNav).removeClass(options.active);
            getRoleListShow();
        });
    });
}
$(".s-content").tabSwitch();
</script>
</body>
</html>

